const crypto = require('crypto')

//密匙

const SECRER_KEY = 'WJiol_8776#'

//md5加密
function md5(content) {
    let md5 = crypto.createHash('md5')
    return md5.update(content).digest('hex')
}

//加密函数
function genPassword(password) {
    const str = `password=${password}&key=${SECRER_KEY}`
    return md5(str)
}

// console.log(genPassword('123'))
module.exports = {
    genPassword,
}